import java.util.Vector;

/**
 * 父类坦克
 */
public class Tank {

    public boolean isLive = true;
    private int x;// 横坐标
    private int y;// 纵坐标
    private int direct;//坦克方向
    private int speed = 1;// 移动速度
    private int type;// 坦克类型  我方--青色  敌方--黄色
    Vector<Shot> shots = new Vector<>();

    public int getDirect() {
        return direct;
    }
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    // 移动方法
    public void up(){
        if(y > 0){
            y -= speed;
        }
    }
    public void down(){
        if (y < 690){
            y += speed;
        }
    }
    public void left(){
        if (x > 0){
            x -= speed;
        }
    }
    public void right(){
        if (x < 940){
            x += speed;
        }
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public void setDirect(int direct) {
        this.direct = direct;
    }

    public Tank(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
}
